#pragma once
#include <handler\handler.h>
#include <buf\recv_buf.h>
#include <buf\send_buf.h>
#include <conn_info.h>
using namespace fly::jld::server;
using namespace fly::jld::buffer;

namespace fly {

	namespace jld{

		namespace test {
			class handler_test :
				public Test
			{
			private:
				handler* handler_;
			public:
				handler_test();
				virtual void SetUp();
				virtual void TearDown();
				
				recv_buf recv_buf_;
				send_buf send_buf_;
				conn_info conn_info_;
				Header header_;

				void encode_header(google::protobuf::Message& msg, const PID pid);
				void encode_body(google::protobuf::Message& msg);

				bool handle_header();
				bool handle_body();

				void decode_header();
				void decode_body(google::protobuf::Message& msg);
			};
		}
	}
}
